package anc.tankshooter.controls;

import org.andengine.entity.sprite.AnimatedSprite;

import anc.tankshooter.ui.ResourcesManager;

public class Checkbox extends AnimatedSprite {

	private boolean mvalue;
	private AnimatedSprite mSprite;
	
	public Checkbox(float x, float y, boolean value)
	{
		super(x, y, ResourcesManager.getInstance().mCheckBoxTexture, ResourcesManager.getInstance().mVertexManager);
		this.mvalue = value;
		if (mvalue) setCurrentTileIndex(1); else setCurrentTileIndex(0);
	}
	
	public void Check()
	{
		if (mvalue) 
		{
			mvalue = false;
			setCurrentTileIndex(0);
		}
		else
		{
			mvalue = true;
			setCurrentTileIndex(1);
		}
	}
	public boolean Value(){
		return mvalue;
	}
}
